<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSectsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sects', function (Blueprint $table) {
            $table->increments('id');
            $table->string('city', 50)->comment('城市码');
            $table->string('name', 50)->comment('名称');
            $table->string('short_name', 20)->comment('简称');
            $table->string('head_avatar', 200)->default('')->comment('头像');
            $table->integer('point')->default(0)->comment('活跃值');
            $table->integer('score')->default(0)->comment('积分');
            $table->integer('is_receive')->default(1)->comment('是否接受申请');
            $table->integer('level_limit')->default(0)->comment('等级限制');
            $table->integer('score_limit')->default(0)->comment('积分限制');
            $table->string('id_barcode', 100)->default("")->comment('身份二维码')->nullable();
            $table->integer('winning_streak')->default(0)->comment('连胜');
            $table->integer('max_winning_streak')->default(0)->comment('最高连胜');

            $table->integer('status')->default(10)->comment('状态(10.筹建，20.成立，90.失效)');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sects');
    }
}
